#ifndef _BSP_PARAM_H
#define _BSP_PARAM_H
#include <stdio.h>
#include <string.h>



//#define FIRMWARE_VERSION "0_official_V1.0.1"
#define FIRMWARE_VERSION "0_official_V1.0.2"
#define OTA_FIRMWARE_VERSION "V1.0.2"
#define VERTYPE "official"
#define HWVER   "A"
/* ota */
enum{
    OTA_IDLE = 0, 
    OTA_REC_REQ = 1,
    OTA_START,
    OTA_SUCCESS,
    OTA_FAIL,
};
/* 发送mqtt 对象 */
enum{
    /* D2S */
    MQTT_SEND_D2S_QD = 0,   // 签到
    MQTT_SEND_D2S_GJ,       // 固件版本获取
    MQTT_SEND_D2S_ACK,      // 应答
    /* D2U */
    MQTT_SEND_D2U_ZT,       // 状态上报
    MQTT_SEND_D2U_ACK,      // ACK
    MQTT_SEND_D2U_OTA,      // OTA状态上报

};
/* MQTT连接 */
enum{
    MQTT_DISCONNECT = 0, 
    MQTT_APP_DISCONNECT = 0,
    MQTT_CONNECT = 1,
    MQTT_APP_CONNECT = 1,
    MQTT_CONNECT_PRIORITY_H = 2,
};

/* BLUFI连接 */
enum{
    BLUFI_BLE_DISCONNECT = 0,
    BLUFI_BLE_CONNECT = 1,
    BLE_CONNECT_PRIORITY_H = 2,
};

/* 系统状态 */
enum{
    SYS_IDLE = 0,
    SYS_STOP = 0,
    SYS_RUN_NORMAL,
    SYS_PAUSE,


};

enum{
    FLASH_OFF = 0,     // 闪烁——关灯
    FLASH_ON,          // 闪烁-开灯
};

/* 错误类型 */
enum{
    ERROR_TYPE_NO_ERROR = 0,
    ERROR_TYPE_NTC_ERROR = 0X01,
};



/* 治疗强度 */
enum{
    POWER_0 = 0,
    POWER_1,
    POWER_2,
    POWER_3,
    POWER_4,
    POWER_5,
    POWER_6,
    POWER_7,
    POWER_8,
    POWER_MAX,
};

/* 治疗时间 */
enum{
    RUN_5MIN = 1,
    RUN_10MIN,
    RUN_15MIN,
    RUN_20MIN,
    RUN_25MIN,
    RUN_30MIN,
    RUN_35MIN,
    RUN_40MIN,
    RUN_45MIN,
    RUN_50MIN,
    RUN_55MIN,
    RUN_60MIN,
    RUN_MIN_MAX,
};
/* 模式 */
enum{
    MODE_AC = 1,
    MODE_DC,
    MODE_MAX,
};
enum{
    GRID1 = 0x00,
    GRID2,
    GRID3,
    GRID4,
    GRID_MAX,
};

enum{
    TEMP_PROTECT_CLOSE,
    TEMP_PROTECT_OPEN,
};

enum{
    COIL_STOP_MOTOR_RUN,
    COIL_MOTOR_STOP,
};


typedef struct  
{
    uint8_t sys_status;                             // 系统状态
    uint8_t sys_mode;                               // 模式
    uint8_t sys_power;                              // 强度
    uint8_t sys_error_type;
    uint8_t sys_runtime;
    uint16_t sys_countdown;
    uint16_t sys_temp_protect;


    uint8_t ifappmqttconnect;       // 手机app是否发送START 表示app也连接上mqtt
    uint8_t ifblufibleconnect;      // 手机app是否连接blufi ble蓝牙
    
}sys_main_param_t;


typedef struct  
{   
    uint8_t send_status;
    uint8_t send_strength;
    uint8_t send_mode;
    uint16_t send_runtime;
    uint16_t send_countdown;
    uint8_t send_error_type;
}send_param_t;











extern uint8_t ota_req_flag;
extern char ota_firm_ver_url[100];


extern void* Get_sys_param_pos(void);
extern void* Get_send_param_pos(void);



#endif


